<?php
/**
 * Created by openXtiger.org.
 * User: xtiger
 * Date: 2009-6-20
 * Time: 11:43:44
 */
function cms_cachemodel_reflashCommon() {
    
    $c = array (
  'MODULE' =>
  array (
    'phpcms' =>
    array (
      'module' => 'phpcms',
      'name' => 'Phpcms',
      'path' => '',
      'url' => '',
      'iscore' => '1',
      'version' => '1.0.0.0',
    ),
    'member' =>
    array (
      'module' => 'member',
      'name' => '会员',
      'path' => 'member/',
      'url' => 'member/',
      'iscore' => '1',
      'version' => '1.0.0.0',
    ),
    'pay' =>
    array (
      'module' => 'pay',
      'name' => '支付',
      'path' => 'pay/',
      'url' => 'pay/',
      'iscore' => '0',
      'version' => '1.0.0.0',
    ),
    'ads' =>
    array (
      'module' => 'ads',
      'name' => '广告管理',
      'path' => 'ads/',
      'url' => 'ads/',
      'iscore' => '0',
      'version' => '1.0.0.0',
    ),
    'space' =>
    array (
      'module' => 'space',
      'name' => '个人空间',
      'path' => 'space/',
      'url' => 'space/',
      'iscore' => '0',
      'version' => '1.0.0.0',
    ),
    'comment' =>
    array (
      'module' => 'comment',
      'name' => '评论',
      'path' => 'comment/',
      'url' => 'comment/',
      'iscore' => '0',
      'version' => '1.0.0.0',
    ),
    'vote' =>
    array (
      'module' => 'vote',
      'name' => '投票问卷',
      'path' => 'vote/',
      'url' => 'vote/',
      'iscore' => '0',
      'version' => '1.0.0.0',
    ),
    'link' =>
    array (
      'module' => 'link',
      'name' => '友情链接',
      'path' => 'link/',
      'url' => 'link/',
      'iscore' => '0',
      'version' => '1.0.0.0',
    ),
    'order' =>
    array (
      'module' => 'order',
      'name' => '订单',
      'path' => 'order/',
      'url' => 'order/',
      'iscore' => '0',
      'version' => '1.0.0.0',
    ),
    'message' =>
    array (
      'module' => 'message',
      'name' => '短消息',
      'path' => 'message/',
      'url' => 'message/',
      'iscore' => '0',
      'version' => '1.0.0.0',
    ),
    'mail' =>
    array (
      'module' => 'mail',
      'name' => '邮箱订阅',
      'path' => 'mail/',
      'url' => 'mail/',
      'iscore' => '0',
      'version' => '1.0.0.0',
    ),
    'guestbook' =>
    array (
      'module' => 'guestbook',
      'name' => '留言板',
      'path' => 'guestbook/',
      'url' => 'guestbook/',
      'iscore' => '0',
      'version' => '1.0.0.0',
    ),
    'announce' =>
    array (
      'module' => 'announce',
      'name' => '网站公告',
      'path' => 'announce/',
      'url' => 'announce/',
      'iscore' => '0',
      'version' => '1.0.0.0',
    ),
    'ask' =>
    array (
      'module' => 'ask',
      'name' => '问吧',
      'path' => 'ask/',
      'url' => 'ask/',
      'iscore' => '0',
      'version' => '1.0.0.0',
    ),
    'digg' =>
    array (
      'module' => 'digg',
      'name' => '顶一下',
      'path' => 'digg/',
      'url' => 'digg/',
      'iscore' => '0',
      'version' => '1.0.0.0',
    ),
    'mood' =>
    array (
      'module' => 'mood',
      'name' => '心情指数',
      'path' => 'mood/',
      'url' => 'mood/',
      'iscore' => '0',
      'version' => '1.0.0.0',
    ),
    'search' =>
    array (
      'module' => 'search',
      'name' => '全站搜索',
      'path' => 'search/',
      'url' => 'search/',
      'iscore' => '0',
      'version' => '1.0.0.0',
    ),
    'special' =>
    array (
      'module' => 'special',
      'name' => '专题',
      'path' => 'special/',
      'url' => 'special/',
      'iscore' => '0',
      'version' => '1.0.0.0',
    ),
    'error_report' =>
    array (
      'module' => 'error_report',
      'name' => '错误报告',
      'path' => 'error_report/',
      'url' => 'error_report/',
      'iscore' => '0',
      'version' => '1.0.0.0',
    ),
    'formguide' =>
    array (
      'module' => 'formguide',
      'name' => '表单向导',
      'path' => 'formguide/',
      'url' => 'formguide/',
      'iscore' => '0',
      'version' => '1.0.0.0',
    ),
    'yp' =>
    array (
      'module' => 'yp',
      'name' => '企业黄页',
      'path' => 'yp/',
      'url' => 'yp/',
      'iscore' => '0',
      'version' => '1.0.0',
    ),
    'spider' =>
    array (
      'module' => 'spider',
      'name' => '采集管理',
      'path' => 'spider/',
      'url' => 'spider/',
      'iscore' => '0',
      'version' => '1.0.0.0',
    ),
  ),
  'MODEL' =>
  array (
    1 =>
    array (
      'modelid' => '1',
      'name' => '新闻',
      'description' => '',
      'tablename' => 'news',
      'itemname' => '新闻',
      'itemunit' => '篇',
      'workflowid' => '1',
      'template_category' => 'category',
      'template_list' => 'list',
      'template_show' => 'show',
      'template_print' => 'print',
      'ishtml' => '1',
      'category_urlruleid' => '1',
      'show_urlruleid' => '7',
      'enablesearch' => '1',
      'ischeck' => '1',
      'isrelated' => '1',
      'disabled' => '0',
      'modeltype' => '0',
    ),
    2 =>
    array (
      'modelid' => '2',
      'name' => '图片',
      'description' => '',
      'tablename' => 'picture',
      'itemname' => '图片',
      'itemunit' => '张',
      'workflowid' => '1',
      'template_category' => 'category_picture',
      'template_list' => 'list_picture',
      'template_show' => 'show_picture',
      'template_print' => 'print',
      'ishtml' => '1',
      'category_urlruleid' => '1',
      'show_urlruleid' => '7',
      'enablesearch' => '1',
      'ischeck' => '1',
      'isrelated' => '1',
      'disabled' => '0',
      'modeltype' => '0',
    ),
    3 =>
    array (
      'modelid' => '3',
      'name' => '下载',
      'description' => '',
      'tablename' => 'down',
      'itemname' => '下载',
      'itemunit' => '条',
      'workflowid' => '1',
      'template_category' => 'category_down',
      'template_list' => 'list_down',
      'template_show' => 'show_down',
      'template_print' => 'print',
      'ishtml' => '1',
      'category_urlruleid' => '1',
      'show_urlruleid' => '7',
      'enablesearch' => '1',
      'ischeck' => '1',
      'isrelated' => '1',
      'disabled' => '0',
      'modeltype' => '0',
    ),
    4 =>
    array (
      'modelid' => '4',
      'name' => '信息',
      'description' => '',
      'tablename' => 'info',
      'itemname' => '信息',
      'itemunit' => '条',
      'workflowid' => '1',
      'template_category' => 'category_info',
      'template_list' => 'list_info',
      'template_show' => 'show_info',
      'template_print' => 'print',
      'ishtml' => '1',
      'category_urlruleid' => '1',
      'show_urlruleid' => '7',
      'enablesearch' => '1',
      'ischeck' => '0',
      'isrelated' => '1',
      'disabled' => '0',
      'modeltype' => '0',
    ),
    5 =>
    array (
      'modelid' => '5',
      'name' => '产品',
      'description' => '',
      'tablename' => 'product',
      'itemname' => '产品',
      'itemunit' => '件',
      'workflowid' => '1',
      'template_category' => 'category_product',
      'template_list' => 'list_product',
      'template_show' => 'show_product',
      'template_print' => 'print',
      'ishtml' => '1',
      'category_urlruleid' => '1',
      'show_urlruleid' => '7',
      'enablesearch' => '1',
      'ischeck' => '1',
      'isrelated' => '1',
      'disabled' => '0',
      'modeltype' => '0',
    ),
    6 =>
    array (
      'modelid' => '6',
      'name' => '视频',
      'description' => '',
      'tablename' => 'video',
      'itemname' => '',
      'itemunit' => '',
      'workflowid' => '1',
      'template_category' => 'category_video',
      'template_list' => 'list_video',
      'template_show' => 'show_video',
      'template_print' => 'print',
      'ishtml' => '0',
      'category_urlruleid' => '4',
      'show_urlruleid' => '10',
      'enablesearch' => '1',
      'ischeck' => '1',
      'isrelated' => '1',
      'disabled' => '0',
      'modeltype' => '0',
    ),
    10 =>
    array (
      'modelid' => '10',
      'name' => '普通会员',
      'description' => '',
      'tablename' => 'detail',
      'itemname' => '',
      'itemunit' => '',
      'workflowid' => '0',
      'template_category' => '',
      'template_list' => '',
      'template_show' => '',
      'template_print' => '',
      'ishtml' => '0',
      'category_urlruleid' => '0',
      'show_urlruleid' => '0',
      'enablesearch' => '1',
      'ischeck' => '0',
      'isrelated' => '1',
      'disabled' => '0',
      'modeltype' => '2',
    ),
    11 =>
    array (
      'modelid' => '11',
      'name' => '企业会员',
      'description' => '企业黄页商家',
      'tablename' => 'company',
      'itemname' => '',
      'itemunit' => '',
      'workflowid' => '0',
      'template_category' => '',
      'template_list' => '',
      'template_show' => '',
      'template_print' => '',
      'ishtml' => '0',
      'category_urlruleid' => '0',
      'show_urlruleid' => '0',
      'enablesearch' => '1',
      'ischeck' => '1',
      'isrelated' => '1',
      'disabled' => '0',
      'modeltype' => '2',
    ),
    12 =>
    array (
      'modelid' => '12',
      'name' => '新闻',
      'description' => '公司新闻',
      'tablename' => 'news',
      'itemname' => '新闻',
      'itemunit' => '篇',
      'workflowid' => '1',
      'template_category' => '',
      'template_list' => '',
      'template_show' => '',
      'template_print' => '',
      'ishtml' => '1',
      'category_urlruleid' => '1',
      'show_urlruleid' => '7',
      'enablesearch' => '1',
      'ischeck' => '1',
      'isrelated' => '1',
      'disabled' => '0',
      'modeltype' => '9',
    ),
    13 =>
    array (
      'modelid' => '13',
      'name' => '产品',
      'description' => '',
      'tablename' => 'product',
      'itemname' => '产品',
      'itemunit' => '篇',
      'workflowid' => '1',
      'template_category' => '',
      'template_list' => '',
      'template_show' => '',
      'template_print' => '',
      'ishtml' => '1',
      'category_urlruleid' => '1',
      'show_urlruleid' => '7',
      'enablesearch' => '1',
      'ischeck' => '1',
      'isrelated' => '1',
      'disabled' => '0',
      'modeltype' => '9',
    ),
    14 =>
    array (
      'modelid' => '14',
      'name' => '商机',
      'description' => '',
      'tablename' => 'buy',
      'itemname' => '商机',
      'itemunit' => '篇',
      'workflowid' => '1',
      'template_category' => '',
      'template_list' => '',
      'template_show' => '',
      'template_print' => '',
      'ishtml' => '1',
      'category_urlruleid' => '1',
      'show_urlruleid' => '7',
      'enablesearch' => '1',
      'ischeck' => '1',
      'isrelated' => '1',
      'disabled' => '0',
      'modeltype' => '9',
    ),
    15 =>
    array (
      'modelid' => '15',
      'name' => '企业招聘',
      'description' => '',
      'tablename' => 'job',
      'itemname' => '名',
      'itemunit' => '篇',
      'workflowid' => '1',
      'template_category' => '',
      'template_list' => '',
      'template_show' => '',
      'template_print' => '',
      'ishtml' => '1',
      'category_urlruleid' => '1',
      'show_urlruleid' => '7',
      'enablesearch' => '1',
      'ischeck' => '1',
      'isrelated' => '1',
      'disabled' => '0',
      'modeltype' => '9',
    ),
  ),
  'TYPE' =>
  array (
    1 =>
    array (
      'typeid' => '1',
      'modelid' => '0',
      'module' => 'link',
      'name' => '默认分类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    2 =>
    array (
      'typeid' => '2',
      'modelid' => '0',
      'module' => 'error_report',
      'name' => '错字',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    3 =>
    array (
      'typeid' => '3',
      'modelid' => '0',
      'module' => 'error_report',
      'name' => '无效URL',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    4 =>
    array (
      'typeid' => '4',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '计算机/互联网类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    5 =>
    array (
      'typeid' => '5',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '通讯/电子/电力类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    6 =>
    array (
      'typeid' => '6',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '市场/销售/业务类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    7 =>
    array (
      'typeid' => '7',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '企业经营/管理类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    8 =>
    array (
      'typeid' => '8',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '财务类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    9 =>
    array (
      'typeid' => '9',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '行政/人事类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    10 =>
    array (
      'typeid' => '10',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '文职类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    11 =>
    array (
      'typeid' => '11',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '广告/装潢/工业设计类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    12 =>
    array (
      'typeid' => '12',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '房地产/建筑类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    13 =>
    array (
      'typeid' => '13',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '翻译类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    14 =>
    array (
      'typeid' => '14',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '制药类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    15 =>
    array (
      'typeid' => '15',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '运输/物流类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    16 =>
    array (
      'typeid' => '16',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '电力/能源/电气类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    17 =>
    array (
      'typeid' => '17',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '化工类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    18 =>
    array (
      'typeid' => '18',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '机械/设备类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    19 =>
    array (
      'typeid' => '19',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '工业/工厂类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    20 =>
    array (
      'typeid' => '20',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '技工类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    21 =>
    array (
      'typeid' => '21',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '商业/旅游/服务业类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    22 =>
    array (
      'typeid' => '22',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '金融/经济类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    23 =>
    array (
      'typeid' => '23',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '文化/教育/新闻/出版类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    24 =>
    array (
      'typeid' => '24',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '轻工类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    25 =>
    array (
      'typeid' => '25',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '医疗/护理/保健类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    26 =>
    array (
      'typeid' => '26',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '律师/法务类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    27 =>
    array (
      'typeid' => '27',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '地矿冶金/测绘技术类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    28 =>
    array (
      'typeid' => '28',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '科学研究类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    29 =>
    array (
      'typeid' => '29',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '航空航天/核工业类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    30 =>
    array (
      'typeid' => '30',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '农林牧渔类',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    31 =>
    array (
      'typeid' => '31',
      'modelid' => '0',
      'module' => 'yp',
      'name' => '其它类别',
      'style' => '',
      'typedir' => '',
      'url' => '',
    ),
    32 =>
    array (
      'typeid' => '32',
      'modelid' => '0',
      'module' => 'special',
      'name' => 'fff',
      'style' => '',
      'typedir' => 'x',
      'url' => 'x/index.html',
    ),
  ),
  'AREA' =>
  array (
    1 =>
    array (
      'areaid' => '1',
      'name' => '北京',
      'style' => '',
      'parentid' => '0',
      'arrparentid' => '0',
      'child' => '0',
      'arrchildid' => '1',
    ),
    2 =>
    array (
      'areaid' => '2',
      'name' => '上海',
      'style' => '',
      'parentid' => '0',
      'arrparentid' => '0',
      'child' => '0',
      'arrchildid' => '2',
    ),
  ),
  'URLRULE' =>
  array (
    1 => '{$categorydir}/index.{$fileext}|{$categorydir}/{$page}.{$fileext}',
    2 => 'category/{$catid}.{$fileext}|category/{$catid}_{$page}.{$fileext}',
    3 => '{$catdir}/index.{$fileext}|{$catdir}/{$page}.{$fileext}',
    4 => 'list.php?catid={$catid}|list.php?catid={$catid}&page={$page}',
    5 => 'list.php?catid-{$catid}.html|list.php?catid-{$catid}/page-{$page}.html',
    6 => 'list-{$catid}-{$page}.html',
    7 => '{$year}/{$month}{$day}/{$contentid}.{$fileext}|{$year}/{$month}{$day}/{$contentid}_{$page}.{$fileext}',
    8 => '{$categorydir}/{$year}/{$month}{$day}/{$contentid}.{$fileext}|{$categorydir}/{$year}/{$month}{$day}/{$contentid}_{$page}.{$fileext}',
    9 => 'show/{$contentid}.{$fileext}|show/{$contentid}_{$page}.{$fileext}',
    10 => 'show.php?contentid={$contentid}|show.php?contentid={$contentid}&page={$page}',
    11 => 'show.php?contentid-{$contentid}.html|show.php?contentid-{$contentid}/page-{$page}.html',
    12 => 'show-{$contentid}-1.html|show-{$contentid}-{$page}.html',
    13 => '{$typedir}/index.{$fileext}|{$typedir}/{$page}.{$fileext}',
    14 => '{$typedir}.{$fileext}|{$typedir}_{$page}.{$fileext}',
    15 => '{$typeid}.{$fileext}|{$typeid}_{$page}.{$fileext}',
    16 => 'list.php?typeid={$typeid}|list.php?typeid={$typeid}&page={$page}',
    17 => 'list.php?typeid-{typeid}.html|list.php?typeid-{typeid}/page-{$page}.html',
    18 => 'list-{$typeid}-{$page}.html',
    19 => '{$typedir}/{$filename}.{$fileext}',
    20 => '{$typedir}_{$filename}.{$fileext}',
    21 => '{$filename}.{$fileext}',
    22 => 'show.php?specialid={$specialid}',
    23 => 'show.php?specialid-{$specialid}.html',
    24 => 'show-{$specialid}.html',
    25 => 'show-{$id}.html',
    26 => 'ask/list-{$catid}-{$action}-1.html|ask/list-{$catid}-{$action}-{$page}.html',
    27 => '{$id}.html',
    28 => 'show.php?id={$id}',
    29 => 'ask/list.php?catid={$catid}&action={$action}|ask/list.php?catid={$catid}&action={$action}&page={$page}',
  )
);
    $db = xt_load('db','icweb');
    $data = array();
	$result = $db->query("SELECT `catid`,`modelid`,`catname`,`parentid`,`parentids`,`child`,`childids` FROM `".xt_tname('cmscategory','icweb')."` ORDER BY `listorder`,`catid`");
	while($r = $db->fetch_array($result)) {
		//$r['url'] = url($r['url']);
		$data[$r['catid']] = $r;
	}
	$db->free_result($result);
	$c['CATEGORY'] = $data;

    $data = array();
	$result = $db->query("SELECT `siteid`,`sitename`,`parentid`,`parentids`,`child`,`childids`,`type` FROM `".xt_tname('cmssite','icweb')."` ORDER BY `listorder`,`siteid`");
	while($r = $db->fetch_array($result)) {
		//$r['url'] = url($r['url']);
		$data[$r['siteid']] = $r;
	}
	$db->free_result($result);
	$c['SITE'] = $data;
    /*$result = $db->query("SELECT `catid`,`type`,`modelid`,`catname`,`style`,`image`,`catdir`,`url`,`parentid`,`arrparentid`,`parentdir`,`child`,`arrchildid`,`items`,`citems`,`pitems`,`ismenu`,`letter` FROM `".xt_tname('cms_category','icweb')."` WHERE 1 ORDER BY `listorder`,`catid`");
	while($r = $db->fetch_array($result)) {
		//$r['url'] = url($r['url']);
		$data[$r['catid']] = $r;
	}
	$db->free_result($result);
	$c['CATEGORY'] = $data;*/

    xt_save('cache','common',$c);
    return $c;
}
function cms_cachemodel_getCommon(){
    $c = xt_load('cache','common');
    if(count($c)==0) {
        return cms_cachemodel_reflashCommon();   
    }
    return $c;
}

?>